#!/usr/bin/env bash

set -eux

# Starting from scratch...
git stash -u
git stash -a

# Build Mill
./mill -i dev.assembly

rm -rf ~/.mill

# Patch local build
ci/patch-mill-bootstrap.sh

# Second build & run tests
out/dev/assembly/dest/mill -i main.test.compile

out/dev/assembly/dest/mill -i all {main,scalalib,scalajslib,scalanativelib,contrib.twirllib,contrib.scalapblib}.test
